import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import App from './App.vue'
import router from './router'
import { retryFailedSyncs } from './utils/dataSyncService'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(ElementPlus)

app.mount('#app')

// 应用启动后，尝试重试失败的预测结果同步
setTimeout(() => {
  retryFailedSyncs().catch(error => {
    console.error('应用启动时重试同步失败:', error)
  })
}, 2000) // 延迟2秒执行，确保页面加载完成
